/**
 * Created by Administrator on 2016/8/25.
 */


define(['common/services','moment'],
    function (services,moment) {
        services.factory('rPacketService', function ($http,$q,Upload,$cacheFactory) {

            return{

                getSysRPList:function(data,cb) {

                    $http.post('/api/rPacket/getSysRPList',data).success(function(data){

                        cb(null,data);

                    }).error(function(err){

                        cb(err,null);
                    });
                },

                createSysRPacket:function(data,cb){
                    $http.post('/api/rPacket/createSysRPacket',data).success(function(data){

                        cb(null,data);

                    }).error(function(err){

                        cb(err,null);
                    });

                },

                changeSysRPStatus:function(sysRPacketId,status,cb){
                    $http.get('/api/rPacket/changeSysRPStatus?sysRPacketId='+sysRPacketId+'&status='+status).success(function(data){

                        cb(null,data);

                    }).error(function(err){

                        cb(err,null);
                    });
                },

                changeSysRPState:function(sysRPacketId,cb){
                    $http.get('/api/rPacket/changeSysRPState?sysRPacketId='+sysRPacketId).success(function(data){

                        cb(null,data);

                    }).error(function(err){

                        cb(err,null);
                    });
                },

                getSysRPDetail:function(sysRPacketId,cb) {

                    $http.get('/api/rPacket/getSysRPDetail?sysRPacketId='+sysRPacketId).success(function(data){

                        cb(null,data);

                    }).error(function(err){

                        cb(err,null);
                    });
                },

                updateRPacket:function(data,cb) {

                    $http.post('/api/rPacket/updateRPacket',data).success(function(data){

                        cb(null,data);

                    }).error(function(err){

                        cb(err,null);
                    });
                },

                getRPTask:function(cb){
                    $http.post('/api/rPacket/getRPTask').success(function(data){

                        cb(null,data);

                    }).error(function(err){

                        cb(err,null);
                    });
                }





            }
        });


    });
